import { ShopOrder } from '@/basePackage/pages/order/types'
import Decimal from 'decimal.js'
/**
 * 订单列表实付款价格计算
 * @returns {*} 需要 divTenThousand 转换
 */
export function computeOrderPrice(data: ShopOrder) {
    return data.shopOrderItems.reduce((pre, cur) => {
        return pre.add(new Decimal(cur.num).mul(cur.dealPrice).sub(cur.fixPrice).add(cur.freightPrice))
    }, new Decimal(0))
}
